package com.bbs.web;

import com.bbs.common.vo.DataResult;
import com.bbs.dto.ForumCollectListDTO;
import com.bbs.service.ForumCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ForumCollectController
 *
 * @author yangjiajia
 * @since 2024/5/13 10:19
 */
@RestController
@RequestMapping("forumCollect")
public class ForumCollectController {

    @Autowired
    private ForumCollectService forumCollectService;

    @GetMapping
    public DataResult collect(@RequestParam("forumId") Integer forumId) {
        return DataResult.success(forumCollectService.collect(forumId));
    }

    @PostMapping("list")
    public DataResult list(@RequestBody ForumCollectListDTO listDTO) {
        return DataResult.success(forumCollectService.list(listDTO));
    }
}
